<?php

//Current way:
// Problems:
// 1. People think it's too verbose
// 2. I'd be inclined to agree

$context = new Yay_Mockery();

$mock1 = $context->mock('Object1');
$mock2 = $context->mock('Object2');

$context->checking(Yay_Expectations::create()
  -> exactly(3)->of($mock1)->foo() -> returns(42)
  -> one($mock2)->bar(true)
  );

$context->assertIsSatisfied();




//Intermediate quicker way:
// Problems:
// 1. I'll have to change expectations fetching logic to fetch on first mock invocation

$context = new Yay_Mockery();

$mock1 = $context->mock('Object1');
$mock2 = $context->mock('Object2');

$context->checking()
  -> exactly(3)->of($mock1)->foo() -> returns(42) // -> after() or before()
  -> one($mock2)->bar(true);

$context->assertIsSatisfied();




//Slim version after further abstraction:
// Problems:
// 1. Brand new syntax causes inconsitency in the API
// 2. Not sure it's readable.  Experimental only!

$context = new Yay_Mockery();

$mock1 = $context->build('Object1)
  -> foo() -> times(3) -> returns(42)
  -> done();

$mock2 = $context->build('Object2')
  -> bar(true) -> once()
  -> done();

$context->assertIsSatisfied(); //How best to invoke this implicitly?
